import { ElMessage } from 'element-plus';

export const useCopy = (text: string) => {
  navigator.clipboard
    .writeText(text)
    .then(() => {
      ElMessage.success(`复制成功，${text}`);
    })
    .catch((err) => {
      throw new Error(err);
    });
};
